package com.my.okhttps.test;

import com.my.core.api.R;
import com.my.okhttps.test.service.IYiBaoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/yibao/yibaoquery")
@Slf4j
public class YiBaoController {

    @Autowired
    private IYiBaoService yiBaoService;

    /**
     * 获取医保账户余额
     * @param idCard
     * @param name
     * @return
     */
    @GetMapping(value = "/getAccountBalance")
    public R<?> getAccountBalance(@RequestParam String idCard,
                                  @RequestParam String name){
        return yiBaoService.getAccountBalance(name,idCard);
    }

    /**
     * 职工基本医疗缴费明细
     * @param idCard
     * @param name
     * @param starDate
     * @param endDate
     * @return
     */
    @GetMapping(value = "/getEmployeeBasePayDetail")
    public R<?> getEmployeeBasePayDetail(@RequestParam String idCard,
                                              @RequestParam String name,
                                              @RequestParam String starDate,
                                              @RequestParam String endDate){
        return yiBaoService.getEmployeeBasePayDetail(name,idCard,starDate,endDate);
    }
}
